from dataclasses import dataclass
from typing import Protocol

from src.application.user import dto
from src.domain.common.constants import Empty, OrderBy


@dataclass(frozen=True)
class GetUsersFilters:
    offset: int | Empty = Empty.UNSET
    limit: int | Empty = Empty.UNSET
    is_registered: bool | Empty = Empty.UNSET
    order: OrderBy = OrderBy.ASC


class UserReader(Protocol):
    async def get_user_by_id(self, user_id: int) -> dto.UserDTO:
        raise NotImplementedError

    async def get_user_by_tg_id(self, user_tg_id: int) -> dto.UserDTO:
        raise NotImplementedError

    async def get_users(self, filters: GetUsersFilters) -> list[dto.UserDTO]:
        raise NotImplementedError
